package com.piece.core.framework.util.validator;

import com.piece.core.framework.exception.ServerException;
import com.piece.core.framework.util.basic.I18nUtil;
import com.piece.core.framework.util.string.StringUtil;

/**
 * 数据校验
 */
public abstract class Assert {

    public static void isBlank(String str, String message) {
        if (StringUtil.isBlank(str)) {
            throw new RuntimeException(I18nUtil.message(message));
        }
    }

    public static void isNull(Object object, String message) {
        if (null == object) {
            throw new ServerException(I18nUtil.message(message));
        }
    }
}
